]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
build: Fix some harmless compiler warnings
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 2 Mar 2020 17:16:25 +0000 (18:16 +0100)
committerFlorian Müllner <florian.muellner@gmail.com>
Sun, 8 Mar 2020 00:34:36 +0000 (00:34 +0000)
Some (newer?) GCC versions complain when a g_auto variable isn't
initialized when declared, even when the initialization is guaranteed
to happen before the variable is used or goes out of scope.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2298

src/shell-app.c
src/st/st-texture-cache.c
subprojects/extensions-tool/src/command-create.c

index 0d314bbb3c35b4209712652ea255750a225275b2..090c6d3d28dddaa50871884347f027d7400c2cb8 100644 (file)
@@ -1295,7 +1295,7 @@ apply_discrete_gpu_env (GAppLaunchContext *context,
   num_children = g_variant_n_children (variant);
   for (i = 0; i < num_children; i++)
     {
-      g_autoptr(GVariant) gpu;
+      g_autoptr(GVariant) gpu = NULL;
       g_autoptr(GVariant) env = NULL;
       g_autoptr(GVariant) default_variant = NULL;
       g_autofree const char **env_s = NULL;
index bb614c6b43aed07db09794d942cbcd04e73e6e36..758c0215f5bc09079885aaf0a10e473e9f182e17 100644 (file)
@@ -142,7 +142,7 @@ on_icon_theme_changed (StSettings     *settings,
                        GParamSpec     *pspec,
                        StTextureCache *cache)
 {
-  g_autofree gchar *theme;
+  g_autofree gchar *theme = NULL;
 
   st_texture_cache_evict_icons (cache);
 
index 2c140bba0b45c48102d900670eea52866ec733db..e32e7c262b2f51730227632ea1dd0861e54c81e7 100644 (file)
@@ -89,7 +89,7 @@ create_metadata (GFile       *target_dir,
 static gboolean
 copy_extension_template (GFile *target_dir, GError **error)
 {
-  g_auto (GStrv) templates;
+  g_auto (GStrv) templates = NULL;
   char **s;
 
   templates = g_resources_enumerate_children (TEMPLATE_PATH, 0, NULL);